package com.chujian.sys.entity;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chujian.framework.core.IId;
import com.chujian.framework.core.IIdName;
import com.chujian.framework.core.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * @author yj
 * @since 2021-08-13
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_dict")
@KeySequence("sys_dict_seq")
public class SysDict extends BaseEntity implements IId, IIdName {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "字典id")
    @TableId("dict_id")
    private Long dictId;


    @ApiModelProperty(value = "字典父id")
    @TableField("dict_pid")
    private Long dictPid;

    @ApiModelProperty(value = "字典子id")
    @TableField("dict_kid")
    private Long dictKid;

    @ApiModelProperty(value = "rootid")
    @TableField("dict_rid")
    private Long dictRid;

    @ApiModelProperty(value = "字典名称")
    @TableField("dict_name")
    private String dictName;

    @ApiModelProperty(value = "排序")
    @TableField("order_no")
    private Integer orderNo;

    @ApiModelProperty(value = "产品id")
    @TableField("prod_id")
    private Long prodId;

    @ApiModelProperty(value = "账套id")
    @TableField("ac_id")
    private Long acId;

    @ApiModelProperty(value = "num1")
    @TableField("num1")
    private Integer num1;

    @ApiModelProperty(value = "num2")
    @TableField("num2")
    private Integer num2;

    @ApiModelProperty(value = "num3")
    @TableField("num3")
    private Integer num3;

    @ApiModelProperty(value = "num4")
    @TableField("num4")
    private Integer num4;

    @ApiModelProperty(value = "num5")
    @TableField("num5")
    private Integer num5;

    @ApiModelProperty(value = "str1")
    @TableField("str1")
    private String str1;

    @ApiModelProperty(value = "str2")
    @TableField("str2")
    private String str2;

    @ApiModelProperty(value = "str3")
    @TableField("str3")
    private String str3;

    @ApiModelProperty(value = "str4")
    @TableField("str4")
    private String str4;

    @ApiModelProperty(value = "str5")
    @TableField("str5")
    private String str5;


    // ++++++ 系统拓展 +++++++
    @TableField(exist = false)
    private Map<String, String> query = new HashMap<>();

    @Override
    public Long getId() {
        return this.dictId;
    }

    @Override
    public void setId(Serializable id) {
        if (null != id) {
            this.dictId = Long.parseLong("" + id);
        }
    }

    @Override
    public String getName() {
        return this.getDictName();
    }

    // ++++++ 业务拓展 +++++++
    @TableField(exist = false)
    private List<SysDict> children;
}
